package com.qx.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.qx.mapper.DetailsMapper;
import com.qx.po.Details;
import com.qx.service.IDetailsService;

@Service("iDetailsService")
public class DetailsServiceImpl implements IDetailsService {
	
@Autowired
	private DetailsMapper detailsMapper; //通过@Autowired向spring容器注入EmployeesMapper
	public void setDetailsMapper(DetailsMapper detailsMapper) {
		this.detailsMapper = detailsMapper;
	}
	@Override
	public Details selectDetailsBydno(String dno) throws Exception {
		Details details = detailsMapper.selectDetailsBydno(dno);
        return details;
	}
	@Override
    //查询所有 Details 信息
    public List<Details> selectDetailsAll() throws Exception {
    	List<Details> details = detailsMapper.selectDetailsAll();
        return details;
    }
	@Override
    //向 Details 表插入一条数据
    public void insertDetails(Details details) throws Exception {
		detailsMapper.insertDetails(details);
    }
	@Override   
    //根据 dno 修改 Details 表数据
    public void updateDetailsBydno(Details details) throws Exception {
		detailsMapper.updateDetailsBydno(details);
    }
	@Override   
    //根据 dno 删除 Details 表数据
    public void deleteDetailsBydno(String dno) throws Exception {
		detailsMapper.deleteDetailsBydno(dno);
    }
	@Override
	public List<Details> selectDetailsBypno(String pno) throws Exception {
		List<Details> details = detailsMapper.selectDetailsBypno(pno);
	    return details;
}

}
